import { ElNotification } from "element-plus";
import { defineStore } from "pinia";

const discussOjStore = defineStore("discuss", {
  state: () => {
    return {
      categoryData: {},
      isCategory: false,
      noticeTotal: 0,
      noReadNoticeNum: 0,
    };
  },
  getters: {
    getCategory() {
      return this.categoryData;
    },
    getNoticeTotal() {
      return this.noticeTotal;
    },
    getNoReadNoticeNum() {
      return this.noReadNoticeNum;
    },
  },
  actions: {
    setCategoryData(data) {
      this.categoryData = data;
      this.isCategory = true;
    },
    clearCategoryData() {
      this.categoryData = [];
      this.isCategory = false;
    },
    setNoticeTotal(data) {
      this.noticeTotal = data;
    },
    setNoReadNoticeNum(data) {
      this.noReadNoticeNum = data;
    },
  },
});

export default discussOjStore;
